home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11993 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: coranto.ucs.mun.ca!usenet
  2. From: saustin@terra.nlnet.nf.ca (Steve Austin)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Can you overload a constructor?
  5. Date: Sun, 17 Mar 1996 17:04:31 GMT
  6. Organization: Kickham Productions
  7. Message-ID: <4ihgmj$5ij@coranto.ucs.mun.ca>
  8. References: <Do859K.K9B@watserv3.uwaterloo.ca> <31483CDC.4B0C@staff.ichange.com> <4ibqan$br5@si-nic.hrz.uni-siegen.de>
  9. NNTP-Posting-Host: n104h129.nlnet.nf.ca
  10. X-Newsreader: Forte Agent .99b.112
  11.  
  12. plrunu@informatik.uni-siegen.de (Runu Knips) wrote:
  13.  
  14. >Sorry, it is impossible to OVERLOAD a constructor.
  15.  
  16. Nonsense. Overloaded constructors are an everyday part of the
  17. language. Why do you think it's possible to have a copy constructor?
  18.  
  19. > A constructor is ALWAYS called, if there is one for a class.
  20.  
  21. There has to be a constructor. How would the class get constructed
  22. otherwise? If you don't supply one, the compiler will.
  23.  
  24. > And before it get called, any constructor for superclasses get called.
  25.  
  26. The question isn't about inheritance. As stated, it's a simple
  27. question about constructor overloading.
  28.  
  29. >... but you can overload and supress a virtual function
  30. >of a superclass.
  31.  
  32. You cannot *overload* a base class function in a derived class, unless
  33. you redefine the base class function in the derived class. 
  34.  
  35. You are mixing up the notions of "overloading" and "overriding".
  36.  
  37. Steve
  38.  
  39.  
  40.